
import 'package:flutter/foundation.dart';

import '../../common_ui/loading.dart';
import '../../repository/api.dart';
import '../../repository/datas/knowledge_list_data.dart';

class KnowledgeViewModel with ChangeNotifier{
  List<KnowledgeListData?>? list;

  Future knowledgeList() async{
    list = await Api.instance.knowledgeList();
    notifyListeners();
  }

  String generalSubTitle(List<KnowledgeChildren>? child){
    if(child ==null || child.isEmpty == true){
      return "";
    }

    StringBuffer stringBuffer = StringBuffer("");

    for(var element in child){
      stringBuffer.write("${element?.name}");
    }
    return stringBuffer.toString();
  }
}